<!--下拉选择器-->
<template>
    <el-select v-model="inputvalue" :placeholder="$t('m.Pleaseselect')+list['title_'+lang]" @change="rulesList">
        <el-option
        v-for="item in list.options"
        :key="item.value"
        :label="item['title_'+lang]"
        :value="item.value"
        >
        </el-option>
    </el-select>
</template>
<script>
    export default {
        props: ["list","lang",'value','isnone'],
        data() {
            return{
                inputvalue:"",
                disable:false,
            }
        },
        mounted(){
            this.rulesList()
        },
        methods:{
            rulesList(){
                var arr=[];
                if(this.list.is_require==1){
                    arr.push({ required: true,message:this.$t('m.Pleaseselect')+this.list['title_'+this.lang]})
                }
                this.$emit('changeRules',this.list.name,arr,this.isnone)
            }
        },
        watch:{
            inputvalue(val,old){
                this.$emit('input',val)
            },
            value:{
                handler(val,old){
                    if(val != "" || val != undefined){
                        this.inputvalue = val;
                    }
                },
                immediate:true,
                deep:true,
            }
        }
    }
</script>